package actions.visitors;

import veilingDomein.Bieding;
import veilingDomein.User;
import veilingDomein.Veiling;
import veilingService.IBiedingService;
import veilingService.IVeilingService;
import veilingService.ServiceProvider;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class SelectVeiling extends ActionSupport {

	private int bod;
	private int veilingId;
	private IBiedingService ibs = ServiceProvider.getBiedingService();
	private IVeilingService ivs = ServiceProvider.getVeilingService();
	private Veiling veiling;
	private Bieding hb;
	private String naam;
	private String beschrijving;
	private int hoogsteBod;
	private User user;
	
	public String execute() {
		
		veiling = ivs.getVeilingByID(veilingId);
		ivs.getMediaBijVeiling(veiling);
		hoogsteBod = ibs.getHoogsteBiedingPerVeiling(veiling.getVeilingId());
		
		naam = veiling.getNaam();
		beschrijving = veiling.getBeschrijving();
		user = veiling.getVeiler();
		return ActionSupport.SUCCESS;
	}
	
	public void setVeilingId(int veilingId) {
		this.veilingId = veilingId;
	}
	
	public String getNaam() {
		return naam;
	}
	
	public String getBeschrijving() {
		return beschrijving;
	}
	
	public int getVeilingId() {
		return veilingId;
	}
	
	public int gethoogsteBod() {
		return hoogsteBod;
	}
	
	public Veiling getVeiling() {
		return veiling;
	}

	public User getUser() {
		return user;
	}

	public int getBod() {
		return bod;
	}

	public void setBod(int bod) {
		this.bod = bod;
	}
	
}
